<template>
  <div style="height:100%;width:100%;position:relative;" ref="maindev">
    <div class="pagetop">
      <table style="width:100%;font-size:12px" border="0">
        <col style="width:5%;" />
        <col style="width:8%" />
        <col style="width:1%" />
        <col style="width:8%" />
        <col style="width:4%" />
        <col style="width:11%" />
        <col style="width:4%" />
        <col style="width:11%" />
        <col style="width:5%" />
        <col style="width:11%" />
        <col style="width:5%" />
        <col style="width:11%" />
        <col style="width:4%" />
        <col style="width:11%" />
        <tr>
          <td align="right">标本日期</td>
          <td>
            <el-date-picker v-model="searchobj.strdate" :clearable="false" type="date" placeholder="选择日期"
              value-format="yyyy-MM-dd" style="width:100%;">
            </el-date-picker>
          </td>
          <td>至</td>
          <td>
            <el-date-picker v-model="searchobj.enddate" type="date" :clearable="false" placeholder="选择日期"
              value-format="yyyy-MM-dd" style="width:100%;"> </el-date-picker>
          </td>
          <td align="right">细菌组</td>
          <td>
            <el-select v-model="searchobj.germcomb"
              @dblclick.native="popMultipleChk(searchobj.germcomb, 'germcomb', germcombOption, '细菌组')"
              style="width: 100%;" filterable clearable>
              <el-option v-for="(item, index) in germcombOption" :key="index" :value="item.data" :label="item.display">
              </el-option>
            </el-select>
          </td>
          <td align="right">样本类型</td>
          <td>
            <el-select v-model="searchobj.sample"
              @dblclick.native="popMultipleChk(searchobj.sample, 'sample', specimenOption, '请选择样本')" style="width: 100%;"
              filterable clearable>
              <el-option v-for="(item, index) in specimenOption" :key="index" :value="item.data"
                :label="item.display"></el-option>
            </el-select>
          </td>
          <td align="right">耐药机制</td>
          <td>
            <rm-ddl-common ref="ddlrescode" datatype="resdict" dataname="耐药机制" v-model="searchobj.resistrule" width="100%"
              @change="resistruleChange" key="3"></rm-ddl-common>
          </td>
          <td align="right">科室</td>
          <td>
            <el-select v-model="searchobj.reqdept"
              @dblclick.native="popMultipleChk(searchobj.reqdept, 'reqdept', deptOption, '申请科室选择')" style="width: 100%;"
              filterable clearable>
              <el-option v-for="(item, index) in deptOption" :key="index" :value="item.data" :label="item.display">
              </el-option>
            </el-select>
          </td>
          <td align="right">病区</td>
          <td>
            <el-select v-model="searchobj.reqward"
              @dblclick.native="popMultipleChk(searchobj.reqward, 'reqward', wardOption, '病区选择')" style="width: 100%;"
              filterable clearable>
              <el-option v-for="(item, index) in wardOption" :key="index" :value="item.data" :label="item.display">
              </el-option>
            </el-select>
          </td>
        </tr>
        <tr>
          <td align="right">报告单元</td>
          <td colspan="3">
            <el-select v-model="searchobj.rptunitid"
              @dblclick.native="popMultipleChk(searchobj.rptunitid, 'rptunitid', rptunitOption, '请选择报告单元')" filterable
              clearable style="width:100%">
              <el-option v-for="(item, index) in rptunitOption" :key="index" :value="item.data"
                :label="item.display"></el-option>
            </el-select>
          </td>
          <td align="right">细菌</td>
          <td>
            <!-- <rm-ddl-common datatype="deptcomb" dataname="科室组" v-model="searchobj.deptgroup" width="100%" @change="deptgroupChange"></rm-ddl-common> -->
            <el-select v-model="searchobj.germrptitemcode"
              @dblclick.native="popMultipleChk(searchobj.germrptitemcode, 'germrptitemcode', germOption, '请选择细菌')"
              filterable clearable style="width:100%">
              <el-option v-for="(item, index) in germOption" :key="index" :value="item.data"
                :label="item.display"></el-option>
            </el-select>
          </td>
          <td align="right">病人类型</td>
          <td>
            <rm-ddl-common datatype="seccode" kindno="PT" dataname="病人类型" v-model="searchobj.pattype"
              @change="pattypeChange" width="100%"></rm-ddl-common>
          </td>
          <td align="right">送检医院</td>
          <td>
            <el-select v-model="searchobj.hospitalcode"
              @dblclick.native="popMultipleChk(searchobj.hospitalcode, 'hospitalcode', hospOption, '请选择送检医院')" filterable
              clearable style="width:100%">
              <el-option v-for="(item, index) in hospOption" :key="index" :value="item.value"
                :label="item.label"></el-option>
            </el-select>
          </td>
          <td align="right">统计前多少</td>
          <td> <el-input v-model="searchobj.frontnum" clearable></el-input> </td>

          <td align="right" colspan="2">
            <el-checkbox true-label="2" false-label="3" v-model="searchobj.germflag2">致病菌</el-checkbox>
            <el-checkbox true-label="1" false-label="0" v-model="searchobj.medflag">带药敏</el-checkbox>
          </td>
        </tr>
        <tr style="height:26px">
          <td align="right">统计方式</td>
          <td colspan="6">
            <el-radio-group v-model="searchobj.bypat" @change="TypeChange">
              <el-radio :label="'0'" style="margin-right:5px">样本类型</el-radio>
              <el-radio :label="'1'" style="margin-right:5px">申请科室</el-radio>
              <el-radio :label="'2'" style="margin-right:5px">送检医院</el-radio>
              <el-radio :label="'3'" style="margin-right:5px">全部</el-radio>
            </el-radio-group>
          </td>
          <td></td>
        </tr>
        <tr>
          <td colspan="14" align="right">
            <el-button @click.native="btnQuery" v-has="'PINQUERY'" type="primary" icon="el-icon-search">查询</el-button>
            <el-button @click.native="btnClear" icon="el-icon-close">清除</el-button>
            <el-button @click.native="btnExport" icon="el-icon-upload2">导出</el-button>
            <!-- <el-button icon="el-icon-printer" @click="btnPrint(1)">打印</el-button>
                      <el-button icon="el-icon-zoom-in" @click="btnPrint(2)">预览</el-button>
                      <el-button icon="el-icon-printer" @click="btnPrint(3)">设计</el-button> -->
          </td>
        </tr>
      </table>
    </div>
    <div class="pagecenter">
      <div class="middle-center">
        <vxe-table :data.sync="tableData" :select-config="{ reserve: true }" :sort-config="{ trigger: 'cell' }" border
          height="auto" highlight-current-row :loading="bLoading" class="mytable-style" highlight-hover-row ref="xTable"
          resizable size="mini" stripe :optimization="{ animat: false }" header-align="center" :key="xTablekey" show-footer
          :footer-cell-class-name="footerCellClassName" :span-method="rowspanMethod" @cell-dblclick="DblEvent"
          :cell-class-name="cellClassName">
          <vxe-table-column v-if="searchobj.bypat === '0'" field="cntname" sortable title="样本类型" width="60" show-overflow
            :formatter="formatFun"></vxe-table-column>
          <vxe-table-column v-else-if="searchobj.bypat === '1'" field="cntname" sortable title="科室" width="150"
            show-overflow :formatter="formatFun"></vxe-table-column>
          <vxe-table-column v-else-if="searchobj.bypat === '2'" field="cntname" sortable title="送检医院" width="150"
            show-overflow :formatter="formatFun"></vxe-table-column>
          <vxe-table-column v-if="searchobj.bypat != '3'" field="样本数" sortable title="样本数" align="center" width="50"
            show-overflow></vxe-table-column>
          <vxe-table-column field="rpt_itemname" sortable title="细菌名称" width="180" show-overflow></vxe-table-column>
          <vxe-table-column field="细菌数" sortable title="细菌数" align="center" width="50" show-overflow></vxe-table-column>
          <vxe-table-column field="检出率" sortable title="检出率" header-align="center" align="right" width="70"
            show-overflow></vxe-table-column>
        </vxe-table>
      </div>
    </div>
    <!--报告项目--->
    <el-dialog width="1000px" top="10px" v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false"
      title="报告项目" :visible.sync="dialogTableVisible1" :destroy-on-close="true">
      <rm-pop-selrptitem @cancel="dialogTableVisible1 = false;" @selitem="addrptitem"></rm-pop-selrptitem>
    </el-dialog>

    <!--多选弹窗--->
    <el-dialog width="900px" v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false" :title="multichktitle"
      :visible.sync="dialogMultipleVisible" :destroy-on-close="true">
      <rm-SqlMultiple :leftOption="option1" :rightOption="option2" :name="fieldname"
        @change="closedialog"></rm-SqlMultiple>
    </el-dialog>

    <el-dialog v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false" :title="detailpoptitle"
      :visible.sync="dialogdetail" width="1000px">
      <div style="height: 500px">
        <vxe-table :data.sync="DetailTableData" :select-config="{ reserve: true }" :loading="detailloading"
          :sort-config="{ trigger: 'cell' }" border height="auto" highlight-current-row class="mytable-style"
          highlight-hover-column highlight-hover-row how-header-overflow ref="DetailpopTable" resizable show-overflow
          size="mini" stripe show-header-overflow header-align="center" show-footer>
          <vxe-table-column field="barcode" sortable title="条码号" width="100" show-overflow></vxe-table-column>
          <vxe-table-column field="specimen_name" sortable title="标本类型" width="80" show-overflow></vxe-table-column>
          <vxe-table-column field="pat_name" sortable title="姓名" width="70" show-overflow></vxe-table-column>
          <vxe-table-column field="pat_sexname" sortable title="性别" width="40" show-overflow></vxe-table-column>
          <vxe-table-column field="pat_agestr" sortable title="年龄岁数" width="60" show-overflow></vxe-table-column>
          <vxe-table-column field="deptname" sortable title="科室" width="100" show-overflow></vxe-table-column>
          <vxe-table-column field="wardname" sortable title="病区" width="100" show-overflow></vxe-table-column>
          <vxe-table-column field="pat_typecodename" sortable title="病人类别" width="60" show-overflow></vxe-table-column>
          <vxe-table-column field="hospitalname" sortable title="医院" width="150" show-overflow>
            <template v-slot="{ row }">
              <div>{{ row.hospitalname == 'All' ? "全部医院" : row.hospitalname }}</div>
            </template>
          </vxe-table-column>
        </vxe-table>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogdetail = false">关 闭</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script type="text/javascript">
import XEUtils from "xe-utils"
export default {
  name: "LIS923",
  data() {
    return {
      sexOption: [
        { label: "", value: "" },
        { label: "男", value: "1" },
        { label: "女", value: "2" },
      ],
      chargeflagOption: [
        { label: "未收费", value: "0" },
        { label: "已收费", value: "1" },
        { label: "等待退费", value: "8" },
        { label: "已退费", value: "9" },
        { label: "免费", value: "5" },
      ],
      bLoading: false,
      is_showselother: false,
      dialogcountItem: false,
      dialogTableVisible1: false,
      dialogMultipleVisible: false,
      option1: [],
      option2: [],
      fieldname: "",
      tableData: [],
      showseq: 1,
      currRowIndex: 0,
      xTablekey: 0,
      datename: "标本日期",
      multichktitle: "",
      daytype: "1",
      pattypeOption: [],
      germOption: [],
      deptOption: [],
      wardOption: [],
      hospOption: [],
      doctorOption: [],
      rptunitOption: [],
      specimenOption: [],
      rptunitGroupOption: [],
      reportcommOption: [],
      germcombOption: [],
      deptgroupOption: [],
      labgroupOption: [],
      //以下为查询条件
      searchobj: {
        strdate: this.$pub.InitDateTime2(0).datefrom,
        enddate: this.$pub.InitDateTime2(0).dateto,
        deptval: "",
        germcomb: "",
        resistrule: "",
        reqward: "",
        sample: "",
        rptunitid: "",
        germrptitemcode: "",
        deptgroup: "",
        patsex: "",
        pattype: "",
        bytype: "",
        bypat: "0",
        germflag2: "3",
        medflag: "0",
        nogermflag: "0",
        deptmode: "0",
        frontnum: "0",
      },
      //以下为排序数组
      sortArr: [],
      detailpoptitle: "",
      dialogdetail: false,
      DetailTableData: [],
      detailloading: false,

    }
  },
  created() {
    this.initOption()
    this.initdate() //初始化时间
  },
  mounted() { },
  updated() { },
  methods: {
    popMultipleChk(e, fieldname, option, title) {
      let temp = XEUtils.clone(option, true)
      this.option1 = []
      this.option2 = []
      if (e != "") {
        let k = e.split(",")
        k.forEach((item) => {
          let ndata = temp.find((m) => m.data == item)
          if (ndata != undefined && ndata != null) {
            this.option2.push(ndata)
          }
        })
        temp.forEach((item) => {
          if (k.indexOf(item.data + "") < 0) {
            this.option1.push(item)
          }
        })
      } else {
        this.option1 = temp
      }
      this.fieldname = fieldname
      this.multichktitle = title
      this.dialogMultipleVisible = true
    },
    closedialog(value, name) {
      if (value != "close") {
        this.searchobj[name] = value
      }
      this.dialogMultipleVisible = false
    },
    //时间初始化
    initdate() {
      var day1 = new Date()
      day1.setTime(day1.getTime())
      var s1 =
        day1.getFullYear() +
        "-" +
        (day1.getMonth() + 1) +
        "-" +
        day1.getDate() +
        " 23:59:59"
      var day2 = new Date()
      day2.setTime(day2.getTime())
      var s2 =
        day2.getFullYear() +
        "-" +
        (day2.getMonth() + 1) +
        "-" +
        day2.getDate() +
        " 00:00:00"
      this.txtsampleDatetime = [s2, s1]
      this.txttimevalue = [
        new Date(2016, 9, 10, 0, 0),
        new Date(2016, 9, 10, 23, 59),
      ]
    },
    addrptitem(rptitemcodeinfos) {
      this.txtrptitem = ""
      for (var i = 0; i < rptitemcodeinfos.length; i++) {
        if (this.txtrptitem == "") {
          this.txtrptitem = rptitemcodeinfos[i].rpt_itemcode
        } else {
          this.txtrptitem += "," + rptitemcodeinfos[i].rpt_itemcode
        }
      }
      this.dialogTableVisible1 = false
    },
    //选择统计项目
    chkcountitem(e, name, code) {
      let tablelist = this.$refs.xTable1.tableData
      let ishave = tablelist.find((m) => m.countitem == name)
      if (e) {
        if (tablelist.length <= 6) {
          if (ishave == undefined) {
            //防止重复插入
            this[code] = true
            this.$refs.xTable1
              .insert({ countitem: name, countcode: code })
              .then(({ row }) => {
                this.$refs.xTable1.setCurrentRow(row)
                this.currRowIndex = tablelist.length - 1
              })
          }
        } else {
          this[code] = false
          this.$alert("您好，最多只能添加7条统计项目！", "提示", {
            confirmButtonText: "确定",
          })
        }
      } else {
        try {
          if (ishave != undefined) {
            this[code] = false
            var alld = this.$refs.xTable1.tableData
            var rowindex = alld.indexOf(ishave)
            this.$refs.xTable1.remove(ishave)
            let havedata = this.$refs.xTable1.tableData
            if (havedata.length > 0) {
              if (rowindex >= havedata.length)
                rowindex = havedata.length - 1
              let selectrow = havedata[rowindex]
              this.$refs.xTable1.setCurrentRow(selectrow)
              this.currRowIndex = rowindex
            }
          }
        } catch (e) {
          console.log("error", e)
        }
      }
    },
    currentChangeEvent1({ row, $rowIndex }) {
      this.currRowIndex = $rowIndex
    },
    btnPrint(type) {
      if (rpt_amount > 0) {
        if (type == 3) {
          this.operate = "design"
        } else {
          this.operate = ""
        }
        var sql =
          "sp_print_PositiveList 'sqlwhere:" +
          this.sqlWhere +
          "','operate:'" +
          this.operate +
          "'"

        if (this.styleid) {
          this.$pub.printlistbill(
            this,
            sql,
            type,
            this.styleid,
            "总汇表",
            ""
          )
        } else {
          return this.$message({
            message: "未获取到打印样式id，请刷新页面后重试",
            type: "warning",
          })
        }
      } else {
        this.$message({
          type: "info",
          message: "请先搜索出数据",
        })
      }
    },
    tabledataup() {
      if (this.currRowIndex > 0) {
        let upData = this.$refs.xTable1.tableData[this.currRowIndex - 1]
        let currentrow = this.$refs.xTable1.tableData[this.currRowIndex]
        this.$refs.xTable1.tableData.splice(this.currRowIndex - 1, 1)
        this.$refs.xTable1.tableData.splice(
          this.currRowIndex,
          0,
          upData
        )
        this.currRowIndex = this.currRowIndex - 1
        this.$nextTick(() => {
          this.$refs.xTable1.setCurrentRow(currentrow)
        })
      }
    },
    tabledatadown() {
      if (this.currRowIndex !== this.$refs.xTable1.tableData.length - 1) {
        let downData = this.$refs.xTable1.tableData[
          this.currRowIndex + 1
        ]
        let currentrow = this.$refs.xTable1.tableData[this.currRowIndex]
        this.$refs.xTable1.tableData.splice(this.currRowIndex + 1, 1)
        this.$refs.xTable1.tableData.splice(
          this.currRowIndex,
          0,
          downData
        )
        this.currRowIndex = this.currRowIndex + 1
        this.$nextTick(() => {
          this.$refs.xTable1.setCurrentRow(currentrow)
        })
      }
    },
    tabledatalast() {
      if (this.currRowIndex != this.$refs.xTable1.tableData.length - 1) {
        let lastData = this.$refs.xTable1.tableData[this.currRowIndex]
        this.$refs.xTable1.tableData.splice(this.currRowIndex, 1)
        this.$refs.xTable1.tableData.splice(
          this.$refs.xTable1.tableData.length,
          0,
          lastData
        )
        this.currRowIndex = this.$refs.xTable1.tableData.length - 1
        this.$nextTick(() => {
          this.$refs.xTable1.setCurrentRow(lastData)
        })
      }
    },
    tabledatafirst() {
      if (this.currRowIndex > 0) {
        let firstData = this.$refs.xTable1.tableData[this.currRowIndex]
        this.$refs.xTable1.tableData.splice(this.currRowIndex, 1)
        this.$refs.xTable1.tableData.splice(0, 0, firstData)
        this.currRowIndex = 0
        this.$nextTick(() => {
          this.$refs.xTable1.setCurrentRow(firstData)
        })
      }
    },
    async initOption() {
      try {
        const res = await this.$tool.request({
          url: "LIS/LIS9/LIS923",
          method: "post",
          data: {
            action: "getOption",
          },
        })
        this.deptgroupOption = res.deptgroupOption
        this.germOption = res.germOption
        this.germcombOption = res.germcombOption
        //
        this.pattypeOption = res.pattypeOption
        this.deptOption = res.deptOption
        console.log("dept", this.deptOption)
        console.log("ward", this.wardOption)
        this.hospOption = res.hospOption
        this.doctorOption = res.doctorOption
        this.rptunitOption = res.rptunitOption
        this.rptunitGroupOption = res.rptunitGroupOption
        this.reportcommOption = res.reportcommOption
        this.wardOption = res.wardOption
        this.labgroupOption = res.labgroupOption
        this.specimenOption = res.specimenOption
        this.userOption = res.userOption
        this.rescodeOption = res.rescodeOption
      } catch (e) {
        this.$message.warning(e)
      }
    },
    btnQuery() {
      this.InitPage()
    },
    btnClear() {
      this.initdate()
      this.searchobj = {
        strdate: this.$pub.InitDateTime2(0).datefrom,
        enddate: this.$pub.InitDateTime2(0).dateto,
        deptval: "",
        germrptitemcode: "",
        germcomb: "",
        resistrule: "",
        reqward: "",
        sample: "",
        rptunitid: "",
        deptgroup: "",
        patsex: "",
        pattype: "",
        bytype: "",
        bypat: "0",
        nogermflag: "0",
        germflag2: "3",
        medflag: "0",
        deptmode: "0",
        frontnum: "0"
      }
      this.tableData = []
    },
    btnExport() {
      let options = {
        filename: "LIS923 细菌分布-列表检出率.csv",
      }
      this.$refs.xTable.exportCsv(options)
    },
    // BtnPrint() {},
    InitPage() {
      this.bLoading = true
      this.$tool
        .request({
          url: "LIS/LIS9/LIS923",
          method: "post",
          timeout: 600000,
          data: {
            action: "InitPage",
            daytype: this.daytype, //标本日期(1)
            infocode: this.infocode, //要查询的列数
            sortArr: this.sortArr, //排序
            ...this.searchobj,
          },
        })
        .then((response) => {
          ++this.xTablekey
          console.log(response)
          this.tableData = response.Data
          this.bLoading = false
          // if (response.RData.Data.length > 0) {
          //     ++this.xTablekey;
          //     this.tableData = response.RData.Data;
          // } else {
          //     this.$alert("没有查询到符合条件的资料！", "信息", { confirmButtonText: "确定" });
          // }
        })
        .catch((e) => {
          this.bLoading = false
          this.$message.warning(e)
        })
    },

    formatFun({ cellValue, column, row }) {
      if (
        ["cntname"].includes(column.property) &&
        this.searchobj.bypat == "0"
      ) {
        try {
          let specimen_name = this.specimenOption.find(
            (m) => m.data == cellValue
          )
          if (specimen_name != undefined && specimen_name != null) {
            return specimen_name.display
          } else {
            return cellValue
          }
        } catch { }
      } else if (
        ["cntname"].includes(column.property) &&
        this.searchobj.bypat == "1"
      ) {
        try {
          let deptname = this.deptOption.find(
            (m) => m.data == cellValue
          )
          if (deptname != undefined && deptname != null) {
            return deptname.display
          } else {
            return cellValue
          }
        } catch { }
      } else if (
        ["cntname"].includes(column.property) &&
        this.searchobj.bypat == "2"
      ) {
        try {
          let hospname = this.hospOption.find(
            (m) => m.value == cellValue
          )
          if (hospname != undefined && hospname != null) {
            return hospname.label
          } else {
            return cellValue
          }
        } catch { }
      } else {
        return cellValue
      }
    },
    footerCellClassName({ $rowIndex, column, columnIndex }) {
      if (
        columnIndex === 0 ||
        [
          "cp_cnt",
          "cp_amt",
          "cp_rs",
          "cp_samplecnt",
          "cp_redocnt",
        ].includes(column.property)
      ) {
        if ($rowIndex === 0) {
          return "col-blue"
        } else {
          return "col-red"
        }
      }
    },
    cellClassName({ row, column }) {

      if (column.property == "细菌数" && parseInt(row[column.property]) > 0) {
        return "sample-tips";
      }
    },
    DblEvent({ row, rowIndex, $rowIndex, column }) {
      this.detailpoptitle = row.rpt_itemname + "详情";
      this.dialogdetail = true;
      this.dialogloading = true;
      var cntname = row.cntname;
      var rpt_itemname = row.rpt_itemname;
      this.$tool
        .request({
          url: "LIS/LIS9/LIS923",
          method: "post",
          timeout: 600000,
          data: {
            action: "getDetail",
            cntname: cntname,
            rpt_itemname: rpt_itemname,
            ...this.searchobj,
          },
        })
        .then((response) => {
          console.log(response)
          this.DetailTableData = response.Data;
          this.detailloading = false;
        })
        .catch((e) => {
          this.detailloading = false
          this.$message.warning(e)
        })
    },
    TypeChange() {
      this.tableData = []
      this.InitPage()
    },
    footerMethod({ columns, data }) {
      // return [
      //     columns.map((column, columnIndex) => {
      //         if (columnIndex === 0) {
      //             return "总计"
      //         }
      //         if (
      //             [
      //                 "cp_amt",
      //                 "cp_cnt",
      //                 "cp_rs",
      //                 "cp_samplecnt",
      //                 "cp_redocnt",
      //             ].includes(column.property)
      //         ) {
      //             return XEUtils.sum(data, column.property)
      //         }
      //         return null
      //     }),
      // ]
    },
    rowspanMethod({ row, $rowIndex, column, data }) {
      let fields = ["cntname", "样本数"]
      let cellValue = row[column.property]
      if (fields.includes(column.property)) {
        let prevRow = data[$rowIndex - 1]
        let nextRow = data[$rowIndex + 1]
        if (
          prevRow &&
          prevRow[column.property] === cellValue &&
          prevRow.cntname == row.cntname
        ) {
          return { rowspan: 0, colspan: 0 }
        } else {
          let countRowspan = 1
          while (
            nextRow &&
            nextRow[column.property] === cellValue &&
            nextRow.cntname == row.cntname
          ) {
            nextRow = data[++countRowspan + $rowIndex]
          }
          if (countRowspan > 1) {
            return { rowspan: countRowspan, colspan: 1 }
          }
        }
      }
    },
    deptchange() { },
    wardchange() { },
    specimenchange() { },
    rptunitChange() { },
    pattypeChange() { },
    resistruleChange() { },
    deptgroupChange() { },
  },
}
</script>

<style scoped>
.pagetop {
  width: 100%;
  height: 130px;
  display: -webkit-box;
  -webkit-box-pack: left;
  -webkit-box-align: center;
  border: 1px solid #ccc;
  position: absolute;
  z-index: 99;
}

.pagecenter {
  position: absolute;
  top: 135px;
  width: 100%;
  left: 0;
  bottom: 0px;
  overflow: auto;
}

.middle-center {
  position: absolute;
  height: 100%;
  left: 0px;
  right: 0px;
  overflow: auto;
}

.el-checkbox__label {
  padding: 0px;
}

.left_nav {
  width: 20%;
  height: 100%;
  border-right: 1px solid #ccc;
  padding: 0px 0px 0px 0px;
  float: left;
  display: inline;
}

.left_nav div {
  cursor: pointer;
  height: 40px;
  width: 100%;
  float: left;
  padding-left: 20px;
  line-height: 40px;
}

.left_nav .active {
  background-color: DeepSkyBlue;
}

.right_nav {
  width: 80%;
  height: 100%;
  display: inline-block;
  vertical-align: top;
  float: left;
  display: inline;
}

table {
  font-size: 12px;
  border-collapse: separate;
  border-spacing: 5px;
}

.table1style tr td {
  padding: 0px 2px 0px 5px;
}

::v-deep .mytable-style .vxe-footer--column.col-blue {
  color: blue !important;
  font-weight: bold;
}

::v-deep .mytable-style .vxe-body--row.row-blue {
  color: blue !important;
  font-weight: bold;
}

::v-deep .el-checkbox__label {
  padding-left: 0px;
}

::v-deep .el-icon-time {
  line-height: 18px !important;
}

::v-deep .el-range__close-icon {
  line-height: 18px !important;
}

::v-deep .el-range-editor--small .el-range-separator {
  line-height: 17px !important;
}

::v-deep.el-input--suffix .el-input__inner {
  padding-right: 0px;
}

::v-deep .sample-tips {
  color: blue;
  cursor: pointer;
  text-decoration: underline;
}</style>
